/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Formas;

import java.awt.Graphics;
import java.awt.Polygon;

/**
 *
 * @author Pedro
 */
public class Poligono extends Forma {

    private Polygon poligono;

    public Poligono(int[] pontosX, int[] pontosY, int n)
    {
        super(pontosX[0],pontosY[0]);
        poligono = new Polygon(pontosX, pontosY, n);
    }

    @Override
    public Forma drawForma(Graphics g) {
       g.setColor(super.getCor());
       g.drawPolygon(this.poligono);
       return this;
    }

    /**
     * @return the poligono
     */
    public Polygon getPoligono() {
        return poligono;
    }

    /**
     * @param poligono the poligono to set
     */
    public void setPoligono(Polygon poligono) {
        this.poligono = poligono;
    }
}
